/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('batchcompute', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CancelImageRequest {
  regionId?: string(name='RegionId'),
}

model CancelImageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function cancelImage(ResourceName: string, request: CancelImageRequest): CancelImageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return cancelImageWithOptions(ResourceName, request, headers, runtime);
}

async function cancelImageWithOptions(ResourceName: string, request: CancelImageRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CancelImageResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CancelImage',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/images/${OpenApiUtil.getEncodeParam(ResourceName)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model ChangeJobPriorityRequest {
  regionId?: string(name='RegionId'),
}

model ChangeJobPriorityResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function changeJobPriority(ResourceName: string, request: ChangeJobPriorityRequest): ChangeJobPriorityResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return changeJobPriorityWithOptions(ResourceName, request, headers, runtime);
}

async function changeJobPriorityWithOptions(ResourceName: string, request: ChangeJobPriorityRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ChangeJobPriorityResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ChangeJobPriority',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/jobs/${OpenApiUtil.getEncodeParam(ResourceName)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model CreateAppRequest {
  idempotentToken?: string(name='IdempotentToken'),
  body?: string(name='body'),
}

model CreateAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function createApp(request: CreateAppRequest): CreateAppResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createAppWithOptions(request, headers, runtime);
}

async function createAppWithOptions(request: CreateAppRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateAppResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.idempotentToken)) {
    query['IdempotentToken'] = request.idempotentToken;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = request.body,
  };
  var params = new OpenApi.Params{
    action = 'CreateApp',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/apps`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model CreateClusterRequest {
  regionId?: string(name='RegionId'),
}

model CreateClusterResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function createCluster(request: CreateClusterRequest): CreateClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createClusterWithOptions(request, headers, runtime);
}

async function createClusterWithOptions(request: CreateClusterRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateClusterResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateCluster',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/clusters`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model CreateImageRequest {
  regionId?: string(name='RegionId'),
}

model CreateImageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function createImage(request: CreateImageRequest): CreateImageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createImageWithOptions(request, headers, runtime);
}

async function createImageWithOptions(request: CreateImageRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateImageResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateImage',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/images`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model CreateJobRequest {
  regionId?: string(name='RegionId'),
}

model CreateJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function createJob(request: CreateJobRequest): CreateJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createJobWithOptions(request, headers, runtime);
}

async function createJobWithOptions(request: CreateJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateJobResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateJob',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/jobs`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model DeleteAppRequest {
  qualifier?: string(name='Qualifier'),
}

model DeleteAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function deleteApp(ResourceName: string, request: DeleteAppRequest): DeleteAppResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteAppWithOptions(ResourceName, request, headers, runtime);
}

async function deleteAppWithOptions(ResourceName: string, request: DeleteAppRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteAppResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.qualifier)) {
    query['Qualifier'] = request.qualifier;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteApp',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/apps/${OpenApiUtil.getEncodeParam(ResourceName)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model DeleteClusterRequest {
  regionId?: string(name='RegionId'),
}

model DeleteClusterResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function deleteCluster(ResourceName: string, request: DeleteClusterRequest): DeleteClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteClusterWithOptions(ResourceName, request, headers, runtime);
}

async function deleteClusterWithOptions(ResourceName: string, request: DeleteClusterRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteClusterResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteCluster',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/clusters/${OpenApiUtil.getEncodeParam(ResourceName)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model DeleteClusterInstanceRequest {
  regionId?: string(name='RegionId'),
}

model DeleteClusterInstanceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function deleteClusterInstance(ClusterId: string, GroupName: string, InstanceId: string, request: DeleteClusterInstanceRequest): DeleteClusterInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteClusterInstanceWithOptions(ClusterId, GroupName, InstanceId, request, headers, runtime);
}

async function deleteClusterInstanceWithOptions(ClusterId: string, GroupName: string, InstanceId: string, request: DeleteClusterInstanceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteClusterInstanceResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteClusterInstance',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/clusters/${OpenApiUtil.getEncodeParam(ClusterId)}/groups/${OpenApiUtil.getEncodeParam(GroupName)}/instances/${OpenApiUtil.getEncodeParam(InstanceId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model DeleteImageRequest {
  regionId?: string(name='RegionId'),
}

model DeleteImageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function deleteImage(ResourceName: string, request: DeleteImageRequest): DeleteImageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteImageWithOptions(ResourceName, request, headers, runtime);
}

async function deleteImageWithOptions(ResourceName: string, request: DeleteImageRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteImageResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteImage',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/images/${OpenApiUtil.getEncodeParam(ResourceName)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model DeleteJobRequest {
  regionId?: string(name='RegionId'),
}

model DeleteJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function deleteJob(ResourceName: string, request: DeleteJobRequest): DeleteJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteJobWithOptions(ResourceName, request, headers, runtime);
}

async function deleteJobWithOptions(ResourceName: string, request: DeleteJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteJobResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteJob',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/jobs/${OpenApiUtil.getEncodeParam(ResourceName)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model DeleteProjectRequest {
  regionId?: string(name='RegionId'),
}

model DeleteProjectResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function deleteProject(ProjectName: string, request: DeleteProjectRequest): DeleteProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteProjectWithOptions(ProjectName, request, headers, runtime);
}

async function deleteProjectWithOptions(ProjectName: string, request: DeleteProjectRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProjectResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteProject',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/projects/${OpenApiUtil.getEncodeParam(ProjectName)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model GetAppRequest {
  detail?: string(name='Detail'),
  qualifier?: string(name='Qualifier'),
  revisions?: string(name='Revisions'),
  scope?: string(name='Scope'),
}

model GetAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function getApp(ResourceName: string, request: GetAppRequest): GetAppResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getAppWithOptions(ResourceName, request, headers, runtime);
}

async function getAppWithOptions(ResourceName: string, request: GetAppRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetAppResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.detail)) {
    query['Detail'] = request.detail;
  }
  if (!Util.isUnset(request.qualifier)) {
    query['Qualifier'] = request.qualifier;
  }
  if (!Util.isUnset(request.revisions)) {
    query['Revisions'] = request.revisions;
  }
  if (!Util.isUnset(request.scope)) {
    query['Scope'] = request.scope;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetApp',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/apps/${OpenApiUtil.getEncodeParam(ResourceName)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model GetClusterRequest {
  regionId?: string(name='RegionId'),
}

model GetClusterResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function getCluster(ResourceName: string, request: GetClusterRequest): GetClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getClusterWithOptions(ResourceName, request, headers, runtime);
}

async function getClusterWithOptions(ResourceName: string, request: GetClusterRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetClusterResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCluster',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/clusters/${OpenApiUtil.getEncodeParam(ResourceName)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model GetClusterInstanceRequest {
  regionId?: string(name='RegionId'),
}

model GetClusterInstanceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function getClusterInstance(ClusterId: string, GroupName: string, InstanceId: string, request: GetClusterInstanceRequest): GetClusterInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getClusterInstanceWithOptions(ClusterId, GroupName, InstanceId, request, headers, runtime);
}

async function getClusterInstanceWithOptions(ClusterId: string, GroupName: string, InstanceId: string, request: GetClusterInstanceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetClusterInstanceResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetClusterInstance',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/clusters/${OpenApiUtil.getEncodeParam(ClusterId)}/groups/${OpenApiUtil.getEncodeParam(GroupName)}/instances/${OpenApiUtil.getEncodeParam(InstanceId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model GetImageRequest {
  regionId?: string(name='RegionId'),
}

model GetImageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function getImage(ResourceName: string, request: GetImageRequest): GetImageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getImageWithOptions(ResourceName, request, headers, runtime);
}

async function getImageWithOptions(ResourceName: string, request: GetImageRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetImageResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetImage',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/images/${OpenApiUtil.getEncodeParam(ResourceName)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model GetInstanceRequest {
  regionId?: string(name='RegionId'),
}

model GetInstanceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function getInstance(ResourceName: string, TaskName: string, InstanceId: string, request: GetInstanceRequest): GetInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getInstanceWithOptions(ResourceName, TaskName, InstanceId, request, headers, runtime);
}

async function getInstanceWithOptions(ResourceName: string, TaskName: string, InstanceId: string, request: GetInstanceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetInstanceResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetInstance',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/jobs/${OpenApiUtil.getEncodeParam(ResourceName)}/tasks/${OpenApiUtil.getEncodeParam(TaskName)}/instances/${OpenApiUtil.getEncodeParam(InstanceId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model GetJobRequest {
  regionId?: string(name='RegionId'),
}

model GetJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function getJob(ResourceName: string, request: GetJobRequest): GetJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getJobWithOptions(ResourceName, request, headers, runtime);
}

async function getJobWithOptions(ResourceName: string, request: GetJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetJobResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetJob',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/jobs/${OpenApiUtil.getEncodeParam(ResourceName)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model GetJobDescriptionRequest {
  regionId?: string(name='RegionId'),
}

model GetJobDescriptionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function getJobDescription(ResourceName: string, request: GetJobDescriptionRequest): GetJobDescriptionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getJobDescriptionWithOptions(ResourceName, request, headers, runtime);
}

async function getJobDescriptionWithOptions(ResourceName: string, request: GetJobDescriptionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetJobDescriptionResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetJobDescription',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/jobs/${OpenApiUtil.getEncodeParam(ResourceName)}%3Fdescription`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model GetQuotaRequest {
  regionId?: string(name='RegionId'),
}

model GetQuotaResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function getQuota(request: GetQuotaRequest): GetQuotaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getQuotaWithOptions(request, headers, runtime);
}

async function getQuotaWithOptions(request: GetQuotaRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetQuotaResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetQuota',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/quotas`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model GetTaskRequest {
  regionId?: string(name='RegionId'),
}

model GetTaskResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function getTask(ResourceName: string, TaskName: string, request: GetTaskRequest): GetTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getTaskWithOptions(ResourceName, TaskName, request, headers, runtime);
}

async function getTaskWithOptions(ResourceName: string, TaskName: string, request: GetTaskRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetTaskResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTask',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/jobs/${OpenApiUtil.getEncodeParam(ResourceName)}/tasks/${OpenApiUtil.getEncodeParam(TaskName)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model ListAppsRequest {
  marker?: string(name='Marker'),
  maxItemCount?: int32(name='MaxItemCount'),
  scope?: string(name='Scope'),
}

model ListAppsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function listApps(request: ListAppsRequest): ListAppsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listAppsWithOptions(request, headers, runtime);
}

async function listAppsWithOptions(request: ListAppsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListAppsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.marker)) {
    query['Marker'] = request.marker;
  }
  if (!Util.isUnset(request.maxItemCount)) {
    query['MaxItemCount'] = request.maxItemCount;
  }
  if (!Util.isUnset(request.scope)) {
    query['Scope'] = request.scope;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListApps',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/apps`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model ListAvailableInstanceTypeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function listAvailableInstanceType(): ListAvailableInstanceTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listAvailableInstanceTypeWithOptions(headers, runtime);
}

async function listAvailableInstanceTypeWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): ListAvailableInstanceTypeResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'ListAvailableInstanceType',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/available`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model ListClusterInstancesRequest {
  regionId?: string(name='RegionId'),
}

model ListClusterInstancesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function listClusterInstances(ClusterId: string, GroupName: string, request: ListClusterInstancesRequest): ListClusterInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listClusterInstancesWithOptions(ClusterId, GroupName, request, headers, runtime);
}

async function listClusterInstancesWithOptions(ClusterId: string, GroupName: string, request: ListClusterInstancesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListClusterInstancesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListClusterInstances',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/clusters/${OpenApiUtil.getEncodeParam(ClusterId)}/groups/${OpenApiUtil.getEncodeParam(GroupName)}/instances`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model ListClustersRequest {
  regionId?: string(name='RegionId'),
}

model ListClustersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function listClusters(request: ListClustersRequest): ListClustersResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listClustersWithOptions(request, headers, runtime);
}

async function listClustersWithOptions(request: ListClustersRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListClustersResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListClusters',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/clusters`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model ListImagesRequest {
  regionId?: string(name='RegionId'),
}

model ListImagesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function listImages(request: ListImagesRequest): ListImagesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listImagesWithOptions(request, headers, runtime);
}

async function listImagesWithOptions(request: ListImagesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListImagesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListImages',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/images`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model ListInstancesRequest {
  regionId?: string(name='RegionId'),
}

model ListInstancesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function listInstances(ResourceName: string, TaskName: string, request: ListInstancesRequest): ListInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listInstancesWithOptions(ResourceName, TaskName, request, headers, runtime);
}

async function listInstancesWithOptions(ResourceName: string, TaskName: string, request: ListInstancesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListInstancesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListInstances',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/jobs/${OpenApiUtil.getEncodeParam(ResourceName)}/tasks/${OpenApiUtil.getEncodeParam(TaskName)}/instances`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model ListJobsRequest {
  regionId?: string(name='RegionId'),
}

model ListJobsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function listJobs(request: ListJobsRequest): ListJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listJobsWithOptions(request, headers, runtime);
}

async function listJobsWithOptions(request: ListJobsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListJobsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListJobs',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/jobs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model ListRegionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function listRegions(): ListRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listRegionsWithOptions(headers, runtime);
}

async function listRegionsWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): ListRegionsResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'ListRegions',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/regions`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model ListTasksRequest {
  regionId?: string(name='RegionId'),
}

model ListTasksResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function listTasks(ResourceName: string, request: ListTasksRequest): ListTasksResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listTasksWithOptions(ResourceName, request, headers, runtime);
}

async function listTasksWithOptions(ResourceName: string, request: ListTasksRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListTasksResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTasks',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/jobs/${OpenApiUtil.getEncodeParam(ResourceName)}/tasks`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model ModifyAppRequest {
  body?: string(name='body'),
}

model ModifyAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function modifyApp(ResourceName: string, request: ModifyAppRequest): ModifyAppResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return modifyAppWithOptions(ResourceName, request, headers, runtime);
}

async function modifyAppWithOptions(ResourceName: string, request: ModifyAppRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ModifyAppResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = request.body,
  };
  var params = new OpenApi.Params{
    action = 'ModifyApp',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/apps/${OpenApiUtil.getEncodeParam(ResourceName)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model ModifyClusterRequest {
  regionId?: string(name='RegionId'),
}

model ModifyClusterResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function modifyCluster(ResourceName: string, request: ModifyClusterRequest): ModifyClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return modifyClusterWithOptions(ResourceName, request, headers, runtime);
}

async function modifyClusterWithOptions(ResourceName: string, request: ModifyClusterRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ModifyClusterResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyCluster',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/clusters/${OpenApiUtil.getEncodeParam(ResourceName)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model PollForTaskRequest {
  regionId?: string(name='RegionId'),
}

model PollForTaskResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function pollForTask(ClusterId: string, WorkerId: string, request: PollForTaskRequest): PollForTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return pollForTaskWithOptions(ClusterId, WorkerId, request, headers, runtime);
}

async function pollForTaskWithOptions(ClusterId: string, WorkerId: string, request: PollForTaskRequest, headers: map[string]string, runtime: Util.RuntimeOptions): PollForTaskResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PollForTask',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/clusters/${OpenApiUtil.getEncodeParam(ClusterId)}/workers/${OpenApiUtil.getEncodeParam(WorkerId)}/fetchTask`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model RecreateClusterInstanceRequest {
  regionId?: string(name='RegionId'),
}

model RecreateClusterInstanceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function recreateClusterInstance(ClusterId: string, GroupName: string, InstanceId: string, request: RecreateClusterInstanceRequest): RecreateClusterInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return recreateClusterInstanceWithOptions(ClusterId, GroupName, InstanceId, request, headers, runtime);
}

async function recreateClusterInstanceWithOptions(ClusterId: string, GroupName: string, InstanceId: string, request: RecreateClusterInstanceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RecreateClusterInstanceResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RecreateClusterInstance',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/clusters/${OpenApiUtil.getEncodeParam(ClusterId)}/groups/${OpenApiUtil.getEncodeParam(GroupName)}/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/recreate`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model RenewClusterInstanceRequest {
  regionId?: string(name='RegionId'),
}

model RenewClusterInstanceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function renewClusterInstance(ClusterId: string, GroupName: string, InstanceId: string, request: RenewClusterInstanceRequest): RenewClusterInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return renewClusterInstanceWithOptions(ClusterId, GroupName, InstanceId, request, headers, runtime);
}

async function renewClusterInstanceWithOptions(ClusterId: string, GroupName: string, InstanceId: string, request: RenewClusterInstanceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RenewClusterInstanceResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RenewClusterInstance',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/clusters/${OpenApiUtil.getEncodeParam(ClusterId)}/groups/${OpenApiUtil.getEncodeParam(GroupName)}/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/renew`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model ReportTaskStatusRequest {
  regionId?: string(name='RegionId'),
}

model ReportTaskStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function reportTaskStatus(ClusterId: string, WorkerId: string, request: ReportTaskStatusRequest): ReportTaskStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return reportTaskStatusWithOptions(ClusterId, WorkerId, request, headers, runtime);
}

async function reportTaskStatusWithOptions(ClusterId: string, WorkerId: string, request: ReportTaskStatusRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ReportTaskStatusResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReportTaskStatus',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/clusters/${OpenApiUtil.getEncodeParam(ClusterId)}/workers/${OpenApiUtil.getEncodeParam(WorkerId)}/updateTaskStatus`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model ReportWorkerStatusRequest {
  regionId?: string(name='RegionId'),
}

model ReportWorkerStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function reportWorkerStatus(ClusterId: string, WorkerId: string, request: ReportWorkerStatusRequest): ReportWorkerStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return reportWorkerStatusWithOptions(ClusterId, WorkerId, request, headers, runtime);
}

async function reportWorkerStatusWithOptions(ClusterId: string, WorkerId: string, request: ReportWorkerStatusRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ReportWorkerStatusResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReportWorkerStatus',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/clusters/${OpenApiUtil.getEncodeParam(ClusterId)}/workers/${OpenApiUtil.getEncodeParam(WorkerId)}/updateStatus`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model StartJobRequest {
  regionId?: string(name='RegionId'),
}

model StartJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function startJob(ResourceName: string, request: StartJobRequest): StartJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return startJobWithOptions(ResourceName, request, headers, runtime);
}

async function startJobWithOptions(ResourceName: string, request: StartJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): StartJobResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartJob',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/jobs/${OpenApiUtil.getEncodeParam(ResourceName)}/start`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

model StopJobRequest {
  regionId?: string(name='RegionId'),
}

model StopJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
}

async function stopJob(ResourceName: string, request: StopJobRequest): StopJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return stopJobWithOptions(ResourceName, request, headers, runtime);
}

async function stopJobWithOptions(ResourceName: string, request: StopJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): StopJobResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopJob',
    version = '2015-11-11',
    protocol = 'HTTPS',
    pathname = `/jobs/${OpenApiUtil.getEncodeParam(ResourceName)}/stop`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

